﻿
@{
    ViewBag.Title = "SalaryDetail";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div style="padding: 16px">
    <div class="layui-card-body">
        <h3>薪资明细</h3>
        <table class="layui-hide" id="sadetail" lay-filter="sadetail"></table>
    </div>
</div>

<script>
    window.onload = function () {

        layui.use(['table', 'tree', 'util'], function () {
            var table = layui.table;
            var util = layui.util;
            var tree = layui.tree
                , layer = layui.layer
                , util = layui.util
            const currentYear = new Date().getFullYear(); // 获取当前年份
            //第一个实例
            table.render({
                elem: '#sadetail'
                , defaultToolbar: []
                , height: "full-100"// 最大高度减去其他容器已占有的高度差
                , toolbar: '#toolbardemosalary'
                , url: '/Salary/SalaryDetailList?s_id='+'@ViewBag.s_id' //数据接口
                , page: true //开启分页
                , limit: 10 //每页默认显示的数量
                , cols: [[
                     { field: 'ParturientName', title: '产妇姓名',width:150 }
                    , { field: 'Phone', title: '产妇电话' }
                    , { field: 'ContractNumber', title: '合同号' }
                    , { field: 'Money', title: '套餐金额' }
                    , { field: 'Deposit', title: '提成比例', templet: function (d) {return d.Deposit+'%' }}
                    , { field: 'ExtraSalary', title: '提成金额' }
                ]]
            });
            $('#basemoney').text('@ViewBag.BaseSalary');
            $('#extramoney').text('@ViewBag.ExtraSalary');
        });
    }
</script>
<script type="text/html" id="toolbardemosalary">
    <div class="layui-btn-container" style="width: auto;">
        <div class="layui-form-item" style="position: relative;">
            <label class="layui-form-label" style="width:90px">底薪</label>
            <label class="layui-form-label" style="width:90px" id="basemoney"></label>
            <label class="layui-form-label" style="width:90px">绩效</label>
            <label class="layui-form-label" style="width:90px" id="extramoney"></label>
        </div>
    </div>
</script>